package com.cqjtu.eecs.mapper;

import com.cqjtu.eecs.entity.RoleUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 用户-角色 Mapper 接口
 * </p>
 *
 * @author     luojun
 * @since 2022-03-04
 */
@Repository
@Mapper
public interface RoleUserMapper extends BaseMapper<RoleUser> {
    // 批量插入
    Integer saveBatch(@Param("list")List<RoleUser> roleUsers);
    // 批量删除
    Integer removeBatch(@Param("uid")Integer uid, @Param("roleIds")List<Integer> roleIds);

    Integer deleteRoleUserByUid(Integer uid);

    /**
     * 根据uid查询用户角色列表
     * @param uid
     * @return
     */
    List<String> getCurrentUserRoleList(Integer uid);
}
